# 1.实现子类继承父类的所有属性及方法。
# 2.子类重写父类方法。
# 3.不同子类重写同一个父类方法
import datetime


class Teacher(object):
    def __init__(self):
        self.name = '张三'
        self.age = 18
        self.sex = '男'

    def get_today(self):
        now = datetime.datetime.now()
        return now


class Studnt1(Teacher):
    def __init__(self):
        self.student = '李四'
        super().__init__()
        print(self.student+"的老师是:"+self.name)
        print('张三年龄为:'+str(self.age))
        print("现在是: "+str(self.get_today()))


class Studnt2(Teacher):
    def get_today(self):
        print('父类的方法被我student2重写了!')


class Studnt3(Teacher):
    def get_today(self):
        print('父类的方法被我student3重写了!')


student1 = Studnt1()
student2 = Studnt2()
student3 = Studnt3()
student2.get_today()
student3.get_today()

